Skip to content

Apply fancy indexing after dark subtraction#904

Merged
psavery merged 1 commit intomasterfrom
apply-fancing-indexing-after-dark
Mar 10, 2026
Merged

Apply fancy indexing after dark subtraction#904
psavery merged 1 commit intomasterfrom
apply-fancing-indexing-after-dark

Conversation

@psavery
Copy link
Copy Markdown
Collaborator

@psavery psavery commented Mar 9, 2026

Overview

pull_spots() performs fancy indexing on the imageseries here.

If a ProcessedImageSeries was used that had dark background subtraction, then the fancy indexing would cause errors to occur. The reason was that the fancy indexing was being performed before the dark background subtraction, which meant that the fancy indexed image would not have a shape that matched the dark background image.

We need to delay fancy indexing until after all operations have finished, so that the fancy indexing doesn't interfere with them. This PR fixes the issue.

Fixes: #903

A test was included that verifies this issue is fixed.

Affected Workflows

HEDM

Documentation Changes

No documentation needed.

`pull_spots()` performs fancy indexing on the imageseries [here](https://github.com/HEXRD/hexrd/blob/625a7950e61aa63f528b343dcc8e82c3b9d9f5f4/hexrd/core/instrument/hedm_instrument.py#L1932).

If a `ProcessedImageSeries` was used that had dark background
subtraction first, then the fancy indexing would cause errors to
occur. The reason was that the fancy indexing was being performed
*before* the dark background subtraction, which meant that the fancy
indexed image would not have a shape that matched the dark
background subtraction.

We need to delay fancy indexing until after all operations have
finished, so that the fancy indexing doesn't interfere with them.
This PR fixes the issue.

Fixes: #903

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.90%. Comparing base (625a795) to head (b4255dc).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #904      +/-   ##
==========================================
- Coverage   70.90%   70.90%   -0.01%     
==========================================
  Files         143      143              
  Lines       22064    22063       -1     
==========================================
- Hits        15645    15644       -1     
  Misses       6419     6419              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psavery psavery requested a review from bnmajor March 9, 2026 20:46
Copy link
Copy Markdown
Collaborator

@bnmajor bnmajor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@psavery psavery merged commit 4e17bfc into master Mar 10, 2026
10 checks passed
@psavery psavery deleted the apply-fancing-indexing-after-dark branch March 10, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants